package com.gk.controller;

import com.gk.dao.CouponHistoryDao;
import com.gk.service.CouponHistoryService;
import com.gk.service.TbIntegrationHistoryService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author: GK
 * @date: 2023/3/16 18:14
 * @version:No1.0
 */
@RestController
public class CouponHistoryController {
    @Resource
    private CouponHistoryService couponHistoryService;

    /**
     * 根据账号和优惠卷id添加优惠卷记录，该接口通作为Feign接口被使用。比如用户消费的时候插入消费记录
     * @return 1
     */
    @RequestMapping("/customer/tbIntegrationHistory/insertIntegrationHistory/{username}/{cid}/{type}")
    public int insertIntegrationHistory(@PathVariable String username, @PathVariable Integer cid, @PathVariable Integer type){
        return couponHistoryService.insertIntegrationHistory(username,cid,type);
    }


}
